if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
    set(CMAKE_PREFIX_PATH
        "/home/yangjian/Workspace/Libs/VTK9/lib/cmake"
        "/home/yangjian/Workspace/Qt/6.7.2/gcc_64/lib/cmake"
    )
    find_package(VTK QUIET)
else()
    message(FATAL_ERROR "Not Support")
endif()

macro(BuildDemo filename)
    set(target vtk_${filename})
    add_executable(${target} ${filename}.cpp)
    target_link_libraries(${target} PRIVATE
        ${VTK_LIBRARIES}
    )
    vtk_module_autoinit(
        TARGETS ${target}
        MODULES ${VTK_LIBRARIES}
    )
endmacro()

if(VTK_FOUND)
    BuildDemo(example_001)
else()
    get_filename_component(CURRENT_DIR_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
    message(STATUS "VTK_LIBRARIES not found! Skipping ${CURRENT_DIR_NAME}")
endif()
